package com.lintesis.lintesismodel.users;

import java.util.Calendar;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import javax.persistence.ManyToOne;



import com.lintesis.lintesismodel.common.hibernate.BussinessObject;

@Entity
public class Person extends BussinessObject
{

	public static final int GENDER_MALE = 0;
	public static final int GENDER_FEMALE = 1;
	// Should add more?

	@javax.persistence.SequenceGenerator(name = "SEQ_PERSON", sequenceName = "SEQ_PERSON", allocationSize = 1)
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PERSON")
	private Integer personId;
	private String idNumber;
	@ManyToOne
	private IdType idType;
	private String name;
	private String surname;
	private Calendar birthday;
	private String address;
	private String telephone;
	private String telephone2; //telefono alternativo
	private String email;
	
	
	private Integer gender;

	
	
	@Override
	public String getObjectDescription() {
		String ret="personId="+personId+", idType="+idType+" idNumber="+idNumber;
		return ret;
	}

	@Override
	public void doAfterDelete()
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void doAfterSave()
	{

	}

	@Override
	public void doBeforeDelete()
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void doBeforeSave()
	{
	}

	@Override
	public Integer getId()
	{
		return this.personId;
	}

	public Integer getPersonId()
	{
		return personId;
	}

	public void setPersonId(Integer personId)
	{
		this.personId = personId;
	}

	public String getIdNumber()
	{
		return idNumber;
	}

	public void setIdNumber(String identificationNumber)
	{
		this.idNumber = identificationNumber;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getSurname()
	{
		return surname;
	}

	public void setSurname(String surname)
	{
		this.surname = surname;
	}

	public String getAddress()
	{
		return address;
	}

	public void setAddress(String address)
	{
		this.address = address;
	}

	public String getTelephone()
	{
		return telephone;
	}

	public void setTelephone(String telephone)
	{
		this.telephone = telephone;
	}

	/**
	 * Returns the identification number type
	 * 
	 * @return
	 */
	public IdType getIdType()
	{
		return idType;
	}

	/**
	 * Sets the identification number type
	 * 
	 * @param identificationType
	 */
	public void setIdType(IdType identificationType)
	{
		this.idType = identificationType;
	}

	public Integer getGender()
	{
		return gender;
	}

	public void setGender(Integer gender)
	{
		this.gender = gender;
	}

	public Calendar getBirthday()
	{
		return birthday;
	}

	public void setBirthday(Calendar birthday)
	{
		this.birthday = birthday;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTelephone2() {
		return telephone2;
	}

	public void setTelephone2(String telephone2) {
		this.telephone2 = telephone2;
	}


}
